﻿using System;
using System.Collections;
using System.Data;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace GPCSC.Webs
{
    /// <summary>
    /// UIFactory:UI对象工厂
    /// </summary>
    /// <remarks>
    /// UI对象工厂支持的类型集合
    /// Calendar,
    /// CurrencyBox,
    /// Button,
    /// DropDownList,
    /// ImageButton,
    /// Label,
    /// NumberBox,
    /// PageView,
    /// PercentBox,
    /// TextBox,
    /// ToolbarTextBox,
    /// LinkButton,
    /// WebEditor,
    /// MultiColumnComboBox,
    /// HtmlInputText,
    /// HtmlTextArea,
    /// HtmlInputHidden,
    /// HtmlInputFile,
    /// HtmlSelect,
    /// RadNumericTextBox
    /// </remarks>
    public class UIFactory : PageBase
    {
        #region UI对象工厂

        /// <summary>
        /// 获取界面所有控件只读
        /// </summary>
        /// <param name="page">页面</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_ReadOnly(Control page)
        {
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            Hashtable pageTable = new Hashtable();

            ReadTopContent(page, pageTable);
            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                //string hashKey = "";
                object hashValue = "";

                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					 * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					 * 请参看:软件规范.xls
					 * */
                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        ((Calendar)pageTable[key]).Enabled = false;
                    //    }
                    //}
                    //if (TypeName == ControlType.RadDateTimePicker.ToString()) //RadDateTimePicker:日期金额控件
                    //{
                    //    ((RadDateTimePicker)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.RadNumericTextBox.ToString()) //RadDateTimePicker:日期金额控件
                    //{
                    //    ((RadNumericTextBox)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    ((CurrencyBox)pageTable[key]).ReadOnly = true;
                    //}
                    //if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    ((NumberBox)pageTable[key]).ReadOnly = true;
                    //}
                    //if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    ((PercentBox)pageTable[key]).ReadOnly = true;

                    //}
                    //if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    ((ToolbarTextBox)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    ((WebEditor)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    ((MultiColumnComboBox)pageTable[key]).TextBox.ReadOnly = true;
                    //}
                    //if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    ((MaskedTextBox)pageTable[key]).ReadOnly = true;
                    //}
                    //if (TypeName == ControlType.ComboBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    ((ComboBox)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.RadComboBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    ((NickLee.WebControls.RadComboBox)pageTable[key]).Enabled = false;
                    //}
                    //if (TypeName == ControlType.WYSIWYGEditor.ToString()) //WYSIWYGEditor:在线编辑器
                    //{
                    //    ((WYSIWYGEditor)pageTable[key]).Enabled = false;
                    //}
                    #endregion

                    #region MS.服务器控件
                    if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    {
                        ((DropDownList)pageTable[key]).Enabled = false;
                    }
                    if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        ((TextBox)pageTable[key]).ReadOnly = true;
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlInputFile.ToString()) //Html上传文件文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    {
                    }
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_errMsg] = e.Message;
                    table[c_obj.p_uiStatic] = false;
                    return table;
                }
            }
            return table;
        }

        /// <summary>
        /// 获取界面所有控件可以输入或者控制
        /// </summary>
        /// <param name="page">页面</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_NotReadOnly(Control page)
        {
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            Hashtable pageTable = new Hashtable();

            ReadTopContent(page, pageTable);
            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                //string hashKey = "";
                object hashValue = "";

                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					 * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					 * 请参看:软件规范.xls
					 * */
                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        ((Calendar)pageTable[key]).Enabled = true;
                    //    }
                    //}
                    //if (TypeName == ControlType.RadDateTimePicker.ToString()) //RadDateTimePicker:日期时间控件
                    //{
                    //    ((RadDateTimePicker)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.RadNumericTextBox.ToString()) //RadNumericTextBox:日期时间控件
                    //{
                    //    ((RadNumericTextBox)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    ((CurrencyBox)pageTable[key]).ReadOnly = false;
                    //}
                    //if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    ((NumberBox)pageTable[key]).ReadOnly = false;
                    //}
                    //if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    ((PercentBox)pageTable[key]).ReadOnly = false;

                    //}
                    //if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    ((ToolbarTextBox)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    ((WebEditor)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    ((MultiColumnComboBox)pageTable[key]).TextBox.ReadOnly = false;
                    //}
                    //if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    ((MaskedTextBox)pageTable[key]).ReadOnly = false;
                    //}
                    //if (TypeName == ControlType.ComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    ((ComboBox)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.RadComboBox.ToString()) //RadComboBox:RadComboBox
                    //{
                    //    ((NickLee.WebControls.RadComboBox)pageTable[key]).Enabled = true;
                    //}
                    //if (TypeName == ControlType.WYSIWYGEditor.ToString()) //RadComboBox:RadComboBox
                    //{
                    //    ((WYSIWYGEditor)pageTable[key]).Enabled = true;
                    //}
                    #endregion

                    #region MS.服务器控件
                    if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    {
                        ((DropDownList)pageTable[key]).Enabled = true;
                    }
                    if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        ((TextBox)pageTable[key]).ReadOnly = false;
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlInputFile.ToString()) //Html上传文件文本框
                    {
                    }
                    if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    {
                    }
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_errMsg] = e.Message;
                    table[c_obj.p_uiStatic] = false;
                    return table;
                }
            }
            return table;
        }

        /// <summary>
        /// 清空页面数据
        /// </summary>
        /// <param name="page">页面</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_Clear(Control page)
        {
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            Hashtable pageTable = new Hashtable();

            ReadTopContent(page, pageTable);
            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                //string hashKey = "";
                object hashValue = "";

                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					 * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					 * 请参看:软件规范.xls
					 * */
                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        ((Calendar)pageTable[key]).SelectedDate = System.DateTime.Now;
                    //    }
                    //}
                    //if (TypeName == ControlType.RadDateTimePicker.ToString()) //RadDateTimePicker:时间日期控件
                    //{
                    //    ((RadDateTimePicker)pageTable[key]).SelectedDate = (DateTime)System.Data.SqlTypes.SqlDateTime.Null;
                    //}
                    //if (TypeName == ControlType.RadNumericTextBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    ((RadNumericTextBox)pageTable[key]).Value = 0;
                    //}
                    //if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    ((CurrencyBox)pageTable[key]).Amount = 0;
                    //}
                    //if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    ((NumberBox)pageTable[key]).Amount = 0;
                    //}
                    //if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    ((PercentBox)pageTable[key]).Amount = 0;

                    //}
                    //if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    ((ToolbarTextBox)pageTable[key]).Text = "";
                    //}
                    //if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    ((WebEditor)pageTable[key]).Content = "";
                    //}
                    //if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    ((MultiColumnComboBox)pageTable[key]).TextBox.Text = "";
                    //}
                    //if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    ((MaskedTextBox)pageTable[key]).Text = "";
                    //}
                    //if (TypeName == ControlType.ComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    ((ComboBox)pageTable[key]).Text = "";
                    //}
                    //if (TypeName == ControlType.RadComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    ((NickLee.WebControls.RadComboBox)pageTable[key]).Text = "";
                    //}
                    //if (TypeName == ControlType.WYSIWYGEditor.ToString()) //ComboBox:ComboBox
                    //{
                    //    ((WYSIWYGEditor)pageTable[key]).Text = "";
                    //}
                    #endregion

                    #region MS.服务器控件
                    //if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    //{
                    //    ((DropDownList)pageTable[key]).Enabled = true;
                    //}
                    if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        ((TextBox)pageTable[key]).Text = "";
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                        ((HtmlInputText)pageTable[key]).Value = "";
                    }
                    if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                        ((HtmlTextArea)pageTable[key]).Value = "";
                    }
                    if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                        ((HtmlInputHidden)pageTable[key]).Value = "";
                    }
                    if (TypeName == ControlType.HtmlInputFile.ToString()) //Html上传文件文本框
                    {
                        ((HtmlInputFile)pageTable[key]).Value = "";
                    }
                    //if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    //{

                    //}
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_errMsg] = e.Message;
                    table[c_obj.p_uiStatic] = false;
                    return table;
                }
            }
            return table;
        }

        /// <summary>
        /// 获取界面所有控件的ID和值
        /// </summary>
        /// <param name="page">页面</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_Get(Control page)
        {
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            table.Add(c_obj.p_errMsg, "");
            Hashtable pageTable = new Hashtable();

            ReadTopContent(page, pageTable);
            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                string hashKey = "";
                object hashValue = "";

                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					 * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					 * 请参看:软件规范.xls
					 * */
                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        if (((Calendar)pageTable[key]).ID.Length > 6 && ((Calendar)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //        {
                    //            hashKey = ((Calendar)pageTable[key]).ID.Substring(6);
                    //            hashValue = ((Calendar)pageTable[key]).SelectedDate;
                    //            table.Add(hashKey, hashValue);
                    //        }
                    //    }
                    //}
                    //if (TypeName == ControlType.RadDateTimePicker.ToString()) //Calendar:日期控件
                    //{
                    //    if (((RadDateTimePicker)pageTable[key]).ID.Length > 6 && ((RadDateTimePicker)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((RadDateTimePicker)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((RadDateTimePicker)pageTable[key]).SelectedDate;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.RadNumericTextBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((RadNumericTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((RadNumericTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((RadNumericTextBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((RadNumericTextBox)pageTable[key]).Value;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((CurrencyBox)pageTable[key]).ID.Length > 6 &&
                    //        ((CurrencyBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((CurrencyBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((CurrencyBox)pageTable[key]).Amount;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    if (((NumberBox)pageTable[key]).ID.Length > 6 && ((NumberBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        hashKey = ((NumberBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((NumberBox)pageTable[key]).Amount;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    if (((PercentBox)pageTable[key]).ID.Length > 6 &&
                    //        ((PercentBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((PercentBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((PercentBox)pageTable[key]).Amount;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    if (((ToolbarTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((ToolbarTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((ToolbarTextBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((ToolbarTextBox)pageTable[key]).Text;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    if (((WebEditor)pageTable[key]).ID.Length > 6 && ((WebEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((WebEditor)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((WebEditor)pageTable[key]).Content;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    if (((MultiColumnComboBox)pageTable[key]).ID.Length > 6 && ((MultiColumnComboBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((MultiColumnComboBox)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((MultiColumnComboBox)pageTable[key]).TextBox.Text;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    if (((MaskedTextBox)pageTable[key]).ClientID.Length > 6 && ((MaskedTextBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((MaskedTextBox)pageTable[key]).ClientID.Substring(6);
                    //        hashValue = ((MaskedTextBox)pageTable[key]).Text;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.ComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    if (((ComboBox)pageTable[key]).ClientID.Length > 6 && ((ComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((ComboBox)pageTable[key]).ClientID.Substring(6);
                    //        hashValue = ((ComboBox)pageTable[key]).SelectedValue;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.RadComboBox.ToString()) //RadComboBox:RadComboBox
                    //{
                    //    if (((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Length > 6 && ((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(6);
                    //        hashValue = ((NickLee.WebControls.RadComboBox)pageTable[key]).SelectedValue;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.WYSIWYGEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    if (((WYSIWYGEditor)pageTable[key]).ID.Length > 6 && ((WYSIWYGEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        hashKey = ((WYSIWYGEditor)pageTable[key]).ID.Substring(6);
                    //        hashValue = ((WYSIWYGEditor)pageTable[key]).Text;
                    //        table.Add(hashKey, hashValue);
                    //    }
                    //}
                    //if (TypeName == ControlType.TextBox.ToString()) //pinToolbar.TextBox:pinToolbar.TextBox
                    //{
                    //    try
                    //    {
                    //        if (((TextBox)pageTable[key]).ID.Length > 6 && ((TextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //        {
                    //            hashKey = ((TextBox)pageTable[key]).ID.Substring(6);
                    //            hashValue = ((TextBox)pageTable[key]).Text;
                    //            table.Add(hashKey, hashValue);
                    //        }
                    //    }
                    //    catch (System.Exception ee)
                    //    {
                    //        if (((NickLee.Web.UI.pinToolbar.TextBox)pageTable[key]).Id.Length > 6 && ((NickLee.Web.UI.pinToolbar.TextBox)pageTable[key]).Id.Substring(4, 1).ToUpper() == "D")
                    //        {
                    //            hashKey = ((NickLee.Web.UI.pinToolbar.TextBox)pageTable[key]).Id.Substring(6);
                    //            hashValue = ((NickLee.Web.UI.pinToolbar.TextBox)pageTable[key]).Text;
                    //            table.Add(hashKey, hashValue);
                    //        }
                    //    }

                    //}
                   
                    #endregion

                    #region MS.服务器控件
                    if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    {
                        if (((DropDownList)pageTable[key]).ID.Length > 6 &&
                            ((DropDownList)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((DropDownList)pageTable[key]).ID.Substring(6);
                            if (((DropDownList)pageTable[key]).Items.Count != 0)
                            {
                                hashValue = ((DropDownList)pageTable[key]).SelectedValue;
                                //								hashValue=((DropDownList)pageTable[key]).SelectedItem.Value;
                            }
                            else
                            {
                                hashValue = 0;
                            }
                            table.Add(hashKey, hashValue);
                        }
                    }
                    if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        if (((TextBox)pageTable[key]).ID.Length > 6 && ((TextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((TextBox)pageTable[key]).ID.Substring(6);
                            hashValue = ((TextBox)pageTable[key]).Text;
                            table.Add(hashKey, hashValue);
                        }
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                        if (((HtmlInputText)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputText)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((HtmlInputText)pageTable[key]).ID.Substring(6);
                            hashValue = ((HtmlInputText)pageTable[key]).Value;
                            table.Add(hashKey, hashValue);
                        }
                    }

                    if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                        if (((HtmlTextArea)pageTable[key]).ID.Length > 6 &&
                            ((HtmlTextArea)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((HtmlTextArea)pageTable[key]).ID.Substring(6);
                            hashValue = ((HtmlTextArea)pageTable[key]).Value;
                            table.Add(hashKey, hashValue);
                        }
                    }
                    if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                        if (((HtmlInputHidden)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputHidden)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((HtmlInputHidden)pageTable[key]).ID.Substring(6);
                            hashValue = ((HtmlInputHidden)pageTable[key]).Value;
                            table.Add(hashKey, hashValue);
                        }
                    }
                    if (TypeName == ControlType.HtmlInputFile.ToString()) //Html上传文件文本框
                    {
                        if (((HtmlInputFile)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputFile)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((HtmlInputFile)pageTable[key]).ID.Substring(6);
                            hashValue = ((HtmlInputFile)pageTable[key]).Value;
                            table.Add(hashKey, hashValue);
                        }
                    }
                    if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    {
                        if (((HtmlInputText)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputText)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            hashKey = ((HtmlSelect)pageTable[key]).ID.Substring(6);
                            if (((HtmlSelect)pageTable[key]).Items.Count != 0)
                            {
                                hashValue = ((HtmlSelect)pageTable[key]).Value;
                            }
                            else
                            {
                                hashValue = 0;
                            }
                            table.Add(hashKey, hashValue);
                        }
                    }
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_uiStatic] = false;
                    table[c_obj.p_errMsg] = e.Message + "<br>" + "类型为" + TypeName + "的控件" + key + "与其他控件重复key:" + hashKey.ToString() + "在页面工厂的HashTable表中,请检查控件ID排除前6位之后是否相同.";
                    continue;
                    //return table;
                }
            }
            return table;
        }

        /// <summary>
        /// 设置界面所有控件的ID和值.默认第1行
        /// </summary>
        /// <param name="page">页面</param>
        /// <param name="inTable">查询结果</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_Set(Control page, DataTable inTable)
        {
            //查询对象生成Hashtable===================================================================
            Hashtable dataHashtable = new Hashtable();
            if (inTable.Rows.Count <= 0)
            {
                return dataHashtable;
            }
            object[] _tempobj = inTable.Rows[0].ItemArray;

            for (int i = 0; i < _tempobj.Length; i++)
            {
                dataHashtable.Add(inTable.Columns[i].Caption, _tempobj[i]);
            }
            //判断====================================================================================
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            table.Add(c_obj.p_errMsg, "");
            Hashtable pageTable = new Hashtable();

            try
            {
                ReadTopContent(page, pageTable);
            }
            catch (System.Exception eee)
            {
                table[c_obj.p_uiStatic] = false;
                table[c_obj.p_errMsg] = eee.Message + "<br>" + "UI工厂错误!请校验数据的正确性!";
                return table;
            }


            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					     * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					     * 请参看:软件规范.xls
					     * */
                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        if (((Calendar)pageTable[key]).ID.Length > 6 && ((Calendar)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //        {
                    //            foreach (object datekey in dataHashtable.Keys)
                    //            {
                    //                if (datekey.ToString().Equals(((Calendar)pageTable[key]).ID.Substring(6)))
                    //                {
                    //                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                    {
                    //                        continue;
                    //                    }
                    //                    ((Calendar)pageTable[key]).SelectedDate = Convert.ToDateTime(dataHashtable[datekey]);
                    //                }
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadDateTimePicker.ToString()) //RadDateTimePicker:时间和日期控件
                    //{
                    //    if (((RadDateTimePicker)pageTable[key]).ID.Length > 6 &&
                    //        ((RadDateTimePicker)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((RadDateTimePicker)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((RadDateTimePicker)pageTable[key]).SelectedDate = Convert.ToDateTime(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadNumericTextBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((RadNumericTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((RadNumericTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((RadNumericTextBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((RadNumericTextBox)pageTable[key]).Value = Convert.ToDouble(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((CurrencyBox)pageTable[key]).ID.Length > 6 &&
                    //        ((CurrencyBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((CurrencyBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((CurrencyBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    if (((NumberBox)pageTable[key]).ID.Length > 6 && ((NumberBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((NumberBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((NumberBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    if (((PercentBox)pageTable[key]).ID.Length > 6 &&
                    //        ((PercentBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((PercentBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((PercentBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    if (((ToolbarTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((ToolbarTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((ToolbarTextBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((ToolbarTextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    if (((WebEditor)pageTable[key]).ID.Length > 6 && ((WebEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((WebEditor)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((WebEditor)pageTable[key]).Content = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    if (((MultiColumnComboBox)pageTable[key]).ID.Length > 6 &&
                    //        ((MultiColumnComboBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((MultiColumnComboBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((MultiColumnComboBox)pageTable[key]).TextBox.Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    if (((MaskedTextBox)pageTable[key]).ClientID.Length > 6 && ((MaskedTextBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((MaskedTextBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((MaskedTextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.ComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    if (((ComboBox)pageTable[key]).ClientID.Length > 6 && ((ComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((ComboBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                try
                    //                {
                    //                    ((ComboBox)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                    //                }
                    //                catch (System.Exception ee)
                    //                {
                    //                    string error = ee.Message;
                    //                }

                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    if (((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Length > 6 && ((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                try
                    //                {
                    //                    ((NickLee.WebControls.RadComboBox)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                    //                }
                    //                catch (System.Exception ee)
                    //                {
                    //                    string error = ee.Message;
                    //                }

                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.WYSIWYGEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    if (((WYSIWYGEditor)pageTable[key]).ID.Length > 6 && ((WYSIWYGEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((WYSIWYGEditor)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((WYSIWYGEditor)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    #endregion

                    #region MS.服务器控件
                     if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    {
                        if (((DropDownList)pageTable[key]).ID.Length > 6 &&
                            ((DropDownList)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((DropDownList)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    if (((DropDownList)pageTable[key]).Items.Count != 0)
                                    {
                                        try
                                        {
                                            ((DropDownList)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                                        }
                                        catch (System.Exception ee)
                                        {
                                            string error = ee.Message;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        if (((TextBox)pageTable[key]).ID.Length > 6 && ((TextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((TextBox)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((TextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.LinkButton.ToString()) //LinkButton:链接按钮
                    {
                        if (((LinkButton)pageTable[key]).ID.Length > 6 &&
                            ((LinkButton)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((LinkButton)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((LinkButton)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.Label.ToString()) //Label:标签
                    {
                        if (((Label)pageTable[key]).ID.Length > 6 &&
                            ((Label)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((Label)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((Label)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.RadioButtonList.ToString()) //RadioButtonList:单选按钮
                    {

                        if (((RadioButtonList)pageTable[key]).ID.Length > 6 &&
                            ((RadioButtonList)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((RadioButtonList)pageTable[key]).ID.Substring(6)))
                                {
                                    if (!dataHashtable.ContainsKey(datekey))
                                    {
                                        continue;
                                    }
                                    if (((RadioButtonList)pageTable[key]).Items.Count != 0)
                                    {
                                        try
                                        {
                                            ((RadioButtonList)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                                        }
                                        catch
                                        {
                                        }
                                    }
                                }
                            }
                        }
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    else if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                        if (((HtmlInputText)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputText)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlInputText)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlInputText)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                        if (((HtmlTextArea)pageTable[key]).ID.Length > 6 &&
                            ((HtmlTextArea)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlTextArea)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlTextArea)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                        if (((HtmlInputHidden)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputHidden)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlInputHidden)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlInputHidden)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    {
                        if (((HtmlSelect)pageTable[key]).ID.Length > 6 &&
                            ((HtmlSelect)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlSelect)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    if (((HtmlSelect)pageTable[key]).Items.Count != 0)
                                    {
                                        ((HtmlSelect)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                    }
                                }
                            }
                        }
                    }
                     else if (TypeName == ControlType.HtmlTableCell.ToString()) //Html单元格
                     {
                         if (((HtmlTableCell)pageTable[key]).ID.Length > 6 &&
                             ((HtmlTableCell)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                         {
                             foreach (object datekey in dataHashtable.Keys)
                             {
                                 if (datekey.ToString().Equals(((HtmlTableCell)pageTable[key]).ID.Substring(6)))
                                 {
                                     if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                     {
                                         continue;
                                     }
                                     else
                                     {
                                         ((HtmlTableCell)pageTable[key]).InnerText = Convert.ToString(dataHashtable[datekey]);
                                     }
                                 }
                             }
                         }
                     }
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_uiStatic] = false;
                    table[c_obj.p_errMsg] = e.Message + "<br>" + "UI工厂错误!请校验数据的正确性!";
                    return table;
                }
            }

            pageTable.Add(c_obj.p_uiStatic, table[c_obj.p_uiStatic]);
            return pageTable;
        }

        /// <summary>
        /// 设置界面所有控件的ID和值
        /// </summary>
        /// <param name="page">页面</param>
        /// <param name="inTable">查询结果</param>
        /// <param name="rows">第几行</param>
        /// <returns>返回的哈希表</returns>
        public static Hashtable UIFactory_Set(Control page, DataTable inTable, int rows)
        {
            //查询对象生成Hashtable===================================================================
            Hashtable dataHashtable = new Hashtable();
            if (inTable.Rows.Count <= 0)
            {
                return dataHashtable;
            }
            object[] _tempobj = inTable.Rows[rows].ItemArray;

            for (int i = 0; i < _tempobj.Length; i++)
            {
                dataHashtable.Add(inTable.Columns[i].Caption, _tempobj[i]);
            }
            //判断====================================================================================
            Hashtable table = new Hashtable();
            table.Add(c_obj.p_uiStatic, true); //设置获取对象的状态
            table.Add(c_obj.p_errMsg, "");
            Hashtable pageTable = new Hashtable();

            ReadTopContent(page, pageTable);

            foreach (object key in pageTable.Keys)
            {
                string TypeName = (pageTable[key]).GetType().Name;
                try
                {
                    #region 判断控件类型,按需要的控件类型获取对应的查询参数

                    /*
					 * 前五位格式:A+ABC+A+'_',A如果为微软的为M,以控件的命名空间首字母,ABC为类型标签,如txt,ddl等等
					 * 请参看:软件规范.xls
					 * */

                    #region NickLee.服务器控件
                    //服务器控件============================================================================================
                    //if (TypeName == ControlType.Calendar.ToString()) //Calendar:日期控件
                    //{
                    //    if (((Calendar)pageTable[key]).ControlType.ToString() == "Picker")
                    //    {
                    //        if (((Calendar)pageTable[key]).ID.Length > 6 && ((Calendar)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //        {
                    //            foreach (object datekey in dataHashtable.Keys)
                    //            {
                    //                if (datekey.ToString().Equals(((Calendar)pageTable[key]).ID.Substring(6)))
                    //                {
                    //                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                    {
                    //                        continue;
                    //                    }
                    //                    ((Calendar)pageTable[key]).SelectedDate = Convert.ToDateTime(dataHashtable[datekey]);
                    //                }
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadDateTimePicker.ToString()) //RadDateTimePicker:时间和日期控件
                    //{
                    //    if (((RadDateTimePicker)pageTable[key]).ID.Length > 6 &&
                    //        ((RadDateTimePicker)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((RadDateTimePicker)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((RadDateTimePicker)pageTable[key]).SelectedDate = Convert.ToDateTime(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadNumericTextBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((RadNumericTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((RadNumericTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((RadNumericTextBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((RadNumericTextBox)pageTable[key]).Value = Convert.ToDouble(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.CurrencyBox.ToString()) //CurrencyBox:金额校验
                    //{
                    //    if (((CurrencyBox)pageTable[key]).ID.Length > 6 &&
                    //        ((CurrencyBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((CurrencyBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((CurrencyBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.NumberBox.ToString()) //NumberBox:数字校验
                    //{
                    //    if (((NumberBox)pageTable[key]).ID.Length > 6 && ((NumberBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((NumberBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((NumberBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.PercentBox.ToString()) //PercentBox:百分比校验
                    //{
                    //    if (((PercentBox)pageTable[key]).ID.Length > 6 &&
                    //        ((PercentBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((PercentBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((PercentBox)pageTable[key]).Amount = Convert.ToDecimal(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.ToolbarTextBox.ToString()) //Toolbar:TextBox:文本框
                    //{
                    //    if (((ToolbarTextBox)pageTable[key]).ID.Length > 6 &&
                    //        ((ToolbarTextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((ToolbarTextBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((ToolbarTextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.WebEditor.ToString()) //WebEditor:在线编辑器
                    //{
                    //    if (((WebEditor)pageTable[key]).ID.Length > 6 && ((WebEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((WebEditor)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((WebEditor)pageTable[key]).Content = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.MultiColumnComboBox.ToString()) //MultiColumnComboBox:MultiColumnCombo
                    //{
                    //    if (((MultiColumnComboBox)pageTable[key]).ID.Length > 6 &&
                    //        ((MultiColumnComboBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((MultiColumnComboBox)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((MultiColumnComboBox)pageTable[key]).TextBox.Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.MaskedTextBox.ToString()) //MaskedTextBox:MaskedTextBox
                    //{
                    //    if (((MaskedTextBox)pageTable[key]).ClientID.Length > 6 && ((MaskedTextBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((MaskedTextBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((MaskedTextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.ComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    if (((ComboBox)pageTable[key]).ClientID.Length > 6 && ((ComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((ComboBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                try
                    //                {
                    //                    ((ComboBox)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                    //                }
                    //                catch (System.Exception ee)
                    //                {
                    //                    string error = ee.Message;
                    //                }
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.RadComboBox.ToString()) //ComboBox:ComboBox
                    //{
                    //    if (((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Length > 6 && ((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(4, 1).ToUpper() == "D")
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((NickLee.WebControls.RadComboBox)pageTable[key]).ClientID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                try
                    //                {
                    //                    ((NickLee.WebControls.RadComboBox)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                    //                }
                    //                catch (System.Exception ee)
                    //                {
                    //                    string error = ee.Message;
                    //                }
                    //            }
                    //        }
                    //    }
                    //}
                    //else if (TypeName == ControlType.WYSIWYGEditor.ToString()) //WYSIWYGEditor:在线编辑器
                    //{
                    //    if (((WYSIWYGEditor)pageTable[key]).ID.Length > 6 && ((WYSIWYGEditor)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D"
                    //        )
                    //    {
                    //        foreach (object datekey in dataHashtable.Keys)
                    //        {
                    //            if (datekey.ToString().Equals(((WYSIWYGEditor)pageTable[key]).ID.Substring(6)))
                    //            {
                    //                if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                    //                {
                    //                    continue;
                    //                }
                    //                ((WYSIWYGEditor)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                    //            }
                    //        }
                    //    }
                    //}
                    #endregion

                    #region MS.服务器控件
                     if (TypeName == ControlType.DropDownList.ToString()) //DropDownList:下拉菜单
                    {
                        if (((DropDownList)pageTable[key]).ID.Length > 6 &&
                            ((DropDownList)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((DropDownList)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    if (((DropDownList)pageTable[key]).Items.Count != 0)
                                    {
                                        try
                                        {
                                            ((DropDownList)pageTable[key]).SelectedValue = Convert.ToString(dataHashtable[datekey]);
                                        }
                                        catch (System.Exception ee)
                                        {
                                            string error = ee.Message;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.TextBox.ToString()) //TextBox:文本框
                    {
                        if (((TextBox)pageTable[key]).ID.Length > 6 && ((TextBox)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((TextBox)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((TextBox)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.LinkButton.ToString()) //LinkButton:链接按钮
                    {
                        if (((LinkButton)pageTable[key]).ID.Length > 6 &&
                            ((LinkButton)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((LinkButton)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((LinkButton)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.Label.ToString()) //Label:标签
                    {
                        if (((Label)pageTable[key]).ID.Length > 6 &&
                            ((Label)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((Label)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((Label)pageTable[key]).Text = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    #endregion

                    #region MS.客户端控件
                    //客户端控件============================================================================================
                    else if (TypeName == ControlType.HtmlInputText.ToString()) //Html文本框
                    {
                        if (((HtmlInputText)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputText)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlInputText)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlInputText)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlTextArea.ToString()) //Html多行文本框
                    {
                        if (((HtmlTextArea)pageTable[key]).ID.Length > 6 &&
                            ((HtmlTextArea)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlTextArea)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlTextArea)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlInputHidden.ToString()) //Html隐藏文本框
                    {
                        if (((HtmlInputHidden)pageTable[key]).ID.Length > 6 &&
                            ((HtmlInputHidden)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlInputHidden)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    ((HtmlInputHidden)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                }
                            }
                        }
                    }
                    else if (TypeName == ControlType.HtmlSelect.ToString()) //Html下拉菜单
                    {
                        if (((HtmlSelect)pageTable[key]).ID.Length > 6 &&
                            ((HtmlSelect)pageTable[key]).ID.Substring(4, 1).ToUpper() == "D")
                        {
                            foreach (object datekey in dataHashtable.Keys)
                            {
                                if (datekey.ToString().Equals(((HtmlSelect)pageTable[key]).ID.Substring(6)))
                                {
                                    if (dataHashtable[datekey] == null || dataHashtable[datekey] == System.DBNull.Value)
                                    {
                                        continue;
                                    }
                                    if (((HtmlSelect)pageTable[key]).Items.Count != 0)
                                    {
                                        ((HtmlSelect)pageTable[key]).Value = Convert.ToString(dataHashtable[datekey]);
                                    }
                                }
                            }
                        }
                    }
                    #endregion

                    #endregion
                }
                catch (Exception e)
                {
                    table[c_obj.p_uiStatic] = false;
                    table[c_obj.p_errMsg] = e.Message + "<br>" + "UI工厂错误!请校验数据的正确性!";
                    return table;
                }
            }

            pageTable.Add(c_obj.p_uiStatic, table[c_obj.p_uiStatic]);
            return pageTable;
        }


        /// <summary>
        /// 枚举控件类型，不满足的不获取参数
        /// 或者以后用xml替代
        /// </summary>
        private enum ControlType
        {
            Calendar,
            RadDateTimePicker,
            CurrencyBox,
            Button,
            DropDownList,
            RadioButtonList,
            ImageButton,
            Label,
            NumberBox,
            PageView,
            PercentBox,
            TextBox,
            ToolbarTextBox,
            LinkButton,
            WebEditor,
            WYSIWYGEditor,
            MultiColumnComboBox,
            ComboBox,
            RadComboBox,
            //pintoolbar
            //pinTextBox,
            //客户端控件
            MaskedTextBox,
            HtmlInputText,
            HtmlTextArea,
            HtmlInputHidden,
            HtmlInputFile,
            HtmlSelect,
            RadNumericTextBox,
            HtmlTableCell
        } ;

        #endregion

        #region 循环获取控件

        /// <summary>
        /// 获取Page页面的控件
        /// </summary>
        /// <param name="page">Page页面</param>
        /// <param name="table">哈希表</param>
        /// <returns>返回的哈希表</returns>
        private static Hashtable ReadTopContent(Control page, Hashtable table)
        {
            int nPageControls = page.Controls.Count;
            for (int i = 0; i < nPageControls; i++)
            {
                foreach (Control control in page.Controls[i].Controls)
                {
                    if (control.ID != null)
                    {
                        if (control.ID.ToString() != "" && control.Visible != false)
                        {
                            table.Add(control.ID, control);
                            if (control.HasControls() == true)
                            {
                                ReadSubContent(control, table);
                            }

                        }
                    }
                }
            }
            return table;
        }

        /// <summary>
        /// 获取控件中的的控件
        /// </summary>
        /// <param name="page">控件</param>
        /// <param name="table">传入的哈希表</param>
        /// <returns>返回的哈希表</returns>
        private static Hashtable ReadSubContent(Control page, Hashtable table)
        {
            foreach (Control control in page.Controls)
            {
                if (control.ID != null)
                {
                    if (control.ID.ToString() != "" && control.Visible != false)
                    {
                        //Grid控件中模版列取法不同,所以加上唯一限制
                        if (table[control.ID] == null)
                        {
                            table.Add(control.ID, control);
                            if (control.HasControls() == true)
                            {
                                ReadSubContent(control, table);
                            }
                        }
                    }
                }
            }
            return table;
        }

        #endregion
    }
}
